package cn.mengfly.fxtest.app;

import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

/**
 * @author Mengfly
 */
public class TitlePaneApp extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {

        VBox advancedVbox = new VBox(
                new Label("All Keywords"),
                new CheckBox(),
                new Label("Domains"),
                new TextField(),
                new Label("Time"),
                new ComboBox<String>(FXCollections.observableArrayList("Day", "Month", "Year"))
        );

        TitledPane titledPane = new TitledPane(
                "Advanced",
                advancedVbox
        );
        titledPane.setExpanded(false);

        VBox vBox = new VBox(
                new Label("Keywords"),
                new TextField()
        );
        vBox.setPadding(new Insets(10));
        vBox.setSpacing(10);

        vBox.getChildren().addAll(titledPane, new Button("Search"));

        Scene scene = new Scene(vBox);
        primaryStage.setTitle("TitlePaneApp");
        primaryStage.setScene(scene);
        primaryStage.setWidth( 568 );
        primaryStage.setHeight( 320 );
        primaryStage.show();

    }
}
